package com.joker.aigc.chat.service;

import com.joker.aigc.chat.domain.entity.websocket.WebSocketAuthorize;
import com.joker.aigc.chat.domain.entity.websocket.WebSocketBaseVo;
import io.netty.channel.Channel;


public interface SocketService {

    /**
     * 验证
     * @param channel
     * @param wsAuthorize
     */
    void authorize(Channel channel, WebSocketAuthorize wsAuthorize);

    /**
     *
     * @param wsBaseResp
     * @param skipUid
     */
    void sendToAllOnline(WebSocketBaseVo<?> wsBaseResp, Long skipUid);

    /**
     * 处理下面任务
     *
     * @param channel
     */
    void removed(Channel channel);

    /**
     * 正式建立请求。将channel放入 集合中
     *
     * @param channel
     */
    void connect(Channel channel);

    /**
     * @param wsBaseResp
     * @param uid
     */
    void sendToUid(WebSocketBaseVo<?> wsBaseResp, Long uid);

    /**
     * 发送消息
     *
     * @param channel
     * @param wsBaseResp
     */
    void sendMsg(Channel channel, WebSocketBaseVo<?> wsBaseResp);

}
